package cn.hl.sfzy.controller;

import cn.hl.sfzy.entity.CourseReply;
import cn.hl.sfzy.entity.CourseTalk;
import cn.hl.sfzy.service.CourseReplyService;
import cn.hl.sfzy.service.CourseTalkService;
import cn.hl.sfzy.util.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName CourseReplyController
 * @Description TODO
 * @Author libowen
 * @Date 2024年10月29日 10:42
 * @Version 1.0
 */
@RestController
@RequestMapping("/CourseReply")
@CrossOrigin
public class CourseReplyController {

    @Autowired
    private CourseReplyService courseReplyService;

    @GetMapping("/findByTalkId")
    public Result selectByTalkId(@RequestParam(required = false,defaultValue = "1") int pageNum, @RequestParam(required = false,defaultValue = "5") int pageSize, Long talk_id) {
        PageInfo<CourseReply> courseReplys = courseReplyService.findByTalkId(pageNum,pageSize,talk_id);
        return Result.success(courseReplys);
    }
}
